package com.telit.firecommand.controller;

import com.telit.common.entity.DataReturn;
import com.telit.firecommand.entity.CommAlarmPrompt;
import com.telit.firecommand.service.CommAlarmPromptService;
import com.telit.firecommand.vo.CommAlarmPromptVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * Create by Chencf 2022/10/23
 */

@Api(tags = "资源管理--报警设置相关接口")
@RestController
@RequestMapping("/commAlarmPrompt")
public class CommAlarmPromptController {


    @Autowired
    private CommAlarmPromptService commAlarmPromptService;


    @ApiOperation("01-新增或者修改报警强制提示 ")
    @PostMapping("/insertOrUpdateAlarmPrompt")
    public DataReturn insertOrUpdateAlarmPrompt(@RequestBody CommAlarmPrompt dto) {
        commAlarmPromptService.insertOrUpdateAlarmPrompt(dto);
        return DataReturn.ok();
    }


    @ApiOperation("02-查询报警设置 ")
    @GetMapping("/getAlarmPrompt")
    public DataReturn<CommAlarmPromptVO> getAlarmPrompt() {
        CommAlarmPromptVO alarmPrompt = commAlarmPromptService.getAlarmPrompt();
        return DataReturn.ok(alarmPrompt);
    }


}
